FROM python:3.8-alpine

RUN echo https://mirrors.ustc.edu.cn/alpine/latest-stable/main > /etc/apk/repositories \
    && echo https://mirrors.ustc.edu.cn/alpine/latest-stable/community >> /etc/apk/repositories \
    && apk update \
    && apk --upgrade add --no-cache gcc \
                                    g++ \
                                    tzdata \
                                    libffi-dev \
                                    openssl-dev \
                                    libxslt-dev \
                                    libtool \
                                    jpeg-dev

ENV  TIME_ZONE Asia/Shanghai
ENV PIPURL "https://mirrors.aliyun.com/pypi/simple"

RUN echo "${TIME_ZONE}" > /etc/timezone \
    && ln -sf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime \
    && pip config set global.index-url ${PIPURL} \
    && mkdir /code

WORKDIR /code